<?php
namespace Admin\Controller;
use Think\Controller;
class UsersController extends Controller {
    public function showList(){
    	$showList=M('users')->where('id')->select();
    	
    	
    	for ($i=0; $i < count($showList); $i++) { 
    		$id=$showList[$i]['id'];
    		$intro=M('users')->where($id)->getField('intro');
    		$str=strip_tags($intro);
    		$str=str_ireplace("", "", "$str");
    		$result=mb_substr($str,0,30, 'utf-8');
    		$showList[$i]['intro']=$result;
    	}
    	
    	$this->assign('showList',$showList);
       $this->display();
    }
    
      function del()
    {
      $id=$_GET['id'];
       $re=M('users')->where($id)->find();
       var_dump($re["pic"]);
        if ($re["pic"]!="") {
          unlink('./Public/Admin/images/'.$re["pic"]);
           echo "删除成功";

       }
       else{
        echo "删除失败";
       }
       $result=M('users')->where($id)->delete();
       if ($result!=null) {
           $this->success("删除成功",U('Users/showList'));
       }
    }


}